package com.zjht.gmcc.servlet.sys;

import java.io.PrintWriter;
import java.sql.PreparedStatement;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.zjht.gmcc.bean.BaseServlet;
import com.zjht.gmcc.bean.util.MyJDBC;


public class TxlAppointEdit extends BaseServlet {

	private static final long serialVersionUID = 1L;

	public boolean process(HttpServletRequest request, HttpServletResponse response,HttpSession session, PrintWriter out, MyJDBC myJDBC,  String menu)throws Exception {
		int i_flag = 0;

		String s_sql = null;
		PreparedStatement ps = null;

		String s_orgacode = request.getParameter("orgacode");
		String s_jhr = request.getParameter("jhr");
		String s_jhdz = request.getParameter("jhdz");
		String s_jhtel = request.getParameter("jhtel");

		s_sql = "update organiza set appointreceiver=?,appointaddress=?,appointtel=? where orgacode=?";
		ps = myJDBC.prepareStatement(s_sql);
		ps.setString(1, s_jhr);
		ps.setString(2, s_jhdz);
		ps.setString(3, s_jhtel);
		ps.setString(4, s_orgacode);
		i_flag = ps.executeUpdate();
		s_sql = null;
		ps.close();
		ps = null;

		String act = "通讯录修改";
		String url = "txl.jsp";
		if (i_flag == 1) {
			alert(out, act + "成功",url);
		} else {
			errAlert(request, out, menu, act + "失败");
		}
		return i_flag == 1;
	}
}
